package tech.$2306.comment.model.vo;

import lombok.Builder;
import lombok.Data;
import tech.$2306.comment.enumeration.RespCodeEnum;

/**
 * @author Wangls
 * @since 2021-04-10 11:13
 */
@Data
@Builder
public class  Response<T> {
    private Integer code;
    private String message;
    private String dialogColor;
    private String dialogTitle;
    private T data;

    public static <T> Response<?> getNormalNotifyMessage() {
        return Response.builder()
                .code(RespCodeEnum.OK.code)
                .message(RespCodeEnum.OK.desc)
                .dialogColor("")
                .dialogTitle("").build();
    }

    public static <T> Response<?> getWarnNotifyMessage() {
        return Response.builder()
                .code(RespCodeEnum.OK.code)
                .message(RespCodeEnum.OK.desc)
                .dialogColor("")
                .dialogTitle("").build();
    }

    public static <T> Response<?> getExceptionNotifyMessage() {
        return Response.builder()
                .code(RespCodeEnum.ERROR.code)
                .message(RespCodeEnum.ERROR.desc)
                .dialogColor("")
                .dialogTitle("").build();
    }

    public static <T> Response<?> getSuccessRespWithData(T data) {
        return Response.builder()
                .code(RespCodeEnum.OK.code)
                .message(RespCodeEnum.OK.desc)
                .data(data).build();
    }





}
